﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WinFormUIXMLParser.ChildForms
{
    public class Manager
    {
        private Dictionary<int, Form> Childs = new Dictionary<int, Form>();

        public Manager(List<Form> list)
        {
            int i = 0;
            foreach (Form f in list)
            {
                Childs.Add(i, f);
                i++;
            }
        }

        public void Show(int key)
        {
            for (int i = 0; i < Childs.Count; i++)
            {
                if (key != i)
                {
                    Childs[i].Hide();
                }              
            }
            Childs[key].Show();
        }

        public void Hide(int key)
        {
            Childs[key].Hide();
        }
    }
}
